import axios from '@/libs/api.request'

export const fetchTypes = (params) => {
  return axios.request({
    url: '/api/template/getScreenType',
    method: 'get',
    params
  })
}

export const fetchTrees = (params) => {
  return axios.request({
    url: '/api/template/getTableTree',
    method: 'get',
    params
  })
}

export const fetchTemplates = params => {
  return axios.request({
    url: '/api/template/getTemplateListPaged',
    method: 'get',
    params
  })
}

export const fetchTemplate = params => {
  return axios.request({
    url: '/api/template/getTemplateByTemplateId',
    method: 'get',
    params
  })
}

export const fetchDeleteTemplate = (data) => {
  return axios.request({
    url: '/api/template/deleteTemplateByTemplateId',
    method: 'post',
    data
  })
}

export const fetchEditTemplate = data => {
  return axios.request({
    url: '/api/template/addTemplate',
    method: 'post',
    data
  })
}
